<div class="row">
    <nav class="navbar navbar-default navbar-static-top">
        <div class="page-title">产品列表</div>
    </nav>
    <div class="show-content">
        <button type="button" class="btn btn-primary add-btn add-apply"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> 添加申请 </button>

        <table class="table table-hover ">
            <tr>
                <th class="col-lg-0.5">ID</th>
                <th class="col-lg-1">名称</th>
                <th class="col-lg-0.5">类别</th>
                <th class="col-lg-2" >APPID</th>
                <th class="col-lg-3" >APPSECRET</th>
                <th>游戏类型</th>
                <th>游戏状态</th>
                <th class="col-sm-1">创建时间</th>
                <th>操作</th>
            </tr>
            @foreach($datas as $data)
            <tr>
                <td>{{$data['id']}}</td>
                <td>{{$data['name']}}</td>
                <td>{{$data['type']}}</td>
                <td>{{$data['app_id']}}</td>
                <td>{{$data['app_secret']}}</td>
                <td>{{$data['class']}}</td>
                <td>{{$data['status']}}</td>
                <td >{{date('Y-m-d H:i:s',$data['create_time'])}}</td>
                <td>
                    <a class=" btn-sm" title="修改" onclick="getData('{{url('/edit_product')}}',{id:'{{$data["id"]}}'})"><span class="glyphicon glyphicon-pencil"  aria-hidden="true"></span></a>
                </td>
            </tr>
                @endforeach
        </table>
    </div>
</div>
{{--   弹出选择框  --}}
<div id="add-layer-ty" style="display: none">
    <div class="col-sm-12 ">
        <p > 游戏类型： </p>
        <select class="form-control">
            <option name="class" value=0>网页免费版</option>
            <option name="class" value=1>网页收费版</option>
            <option name="class" value=2>安卓免费版</option>
            <option name="class" value=3>安卓收费版</option>
        </select>
</div>
</div>
<script>
    $('.add-apply').click(function () {
        layer.open({
            type: 1,
            title: ['请选择你要申请的游戏类型：', 'font-size:18px;'],
            area: ['400px', '300px'],
            closeBtn:2,
            content:$('#add-layer-ty'), //这里content是一个DOM
            btn:['确定','取消'],
            btn1: function(index, layero){
                layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
                let type =  $('option[name="class"]:selected').val();
                console.log(type);
                getData('{{URL::asset('add_product')}}',{'class':type});
            },
            btn2:function (index,layero) {
                layer.close(index)
            }
        });
    })
</script>